﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using TIMETABLEASY.Model;

namespace TIMETABLEASY.Controler
{
    public static class DateEventFilter
    {
        public static IEnumerable<Event> ByDate(this IEnumerable<Event> events, DateTime date)
        {
            if (events != null)
            {
                var app = from a in events
                          where a.StartTime.ToShortDateString() == date.ToShortDateString()
                          select a;
                return app;
            }
            else
            {
                return null;
            }
        }
    }
}
